Initializes a new CorrelationListCommand with explicit parameters.
public CorrelationListCommand(
RasterImage correlationImage,
LeadPoint[] points,
int[] listIndex,
int xStep,
int yStep,
int threshold
)
Public Function New( _
ByVal correlationImage As Leadtools.RasterImage, _
ByVal points() As Leadtools.LeadPoint, _
ByVal listIndex() As Integer, _
ByVal xStep As Integer, _
ByVal yStep As Integer, _
ByVal threshold As Integer _
)
public CorrelationListCommand(
Leadtools.RasterImage correlationImage,
Leadtools.LeadPoint[] points,
int[] listIndex,
int xStep,
int yStep,
int threshold
)
- (instancetype)initWithCorrelationImage:(LTRasterImage *)correlationImage
points:(LeadPoint *)points
listIndex:(NSUInteger *)listIndex
pointsCount:(NSUInteger)pointsCount
xStep:(NSUInteger)xStep
yStep:(NSUInteger)yStep
threshold:(NSUInteger)threshold
public CorrelationListCommand(
RasterImage correlationImage,
LeadPoint[] points,
int[] listIndex,
int xStep,
int yStep,
int threshold
)
function CorrelationListCommand(
correlationImage ,
points ,
listIndex ,
xStep ,
yStep ,
threshold
)
public:
CorrelationListCommand(
Leadtools.RasterImage^ correlationImage,
Leadtools.array<LeadPoint>^ points,
array<int>^ listIndex,
int xStep,
int yStep,
int threshold
)
correlationImage
RasterImage object that references the image(s) for which to search.
points
Array of LeadPoint objects to be updated with the starting points of the correlated areas.
listIndex
Array of integers to be updated with the indices of the images that match correlated areas.
xStep
Step size in the X direction (along image width), in pixels. For best results, use 1.
yStep
Step size in the Y direction (along image height), in pixels. For best results, use 1.
threshold
Value that indicates the correlation threshold, which is a measure of the association necessary for two areas to be considered to be correlated. If the correlation value between an image in the list and an area in the reference image is less than the correlation threshold they are uncorrelated. Valid values range from 0 (zero resemblance) to 100 (perfect resemblance).
Run the CorrelationListCommand on an image
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
public void CorrelationListConstructorExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"));
CopyRectangleCommand copyRectangle = new CopyRectangleCommand();
LeadRect rc_cor = new LeadRect(327, 378, 22, 28);
copyRectangle.Rectangle = rc_cor;
copyRectangle.Run(image);
RasterImage correlationImage = copyRectangle.DestinationImage.Clone();
rc_cor = new LeadRect(283, 378, 22, 28);
copyRectangle.Rectangle = rc_cor;
copyRectangle.Run(image);
correlationImage.AddPage(copyRectangle.DestinationImage.Clone());
LeadPoint[] points = new LeadPoint[30];
int[] listIndex = new int[30];
CorrelationListCommand command = new CorrelationListCommand(correlationImage, points, listIndex, 1, 1, 90);
command.Run(image);
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Core
Leadtools.Examples.Support.SetLicense()
Public Sub CorrelationListConstructorExample()
' Load an image
Dim codecs As RasterCodecs = New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"))
Dim copyRectangle As CopyRectangleCommand = New CopyRectangleCommand()
Dim rc_cor As LeadRect = New LeadRect(327, 378, 22, 28)
copyRectangle.Rectangle = rc_cor
copyRectangle.Run(image)
Dim correlationImage As RasterImage = copyRectangle.DestinationImage.Clone()
rc_cor = New LeadRect(283, 378, 22, 28)
copyRectangle.Rectangle = rc_cor
copyRectangle.Run(image)
correlationImage.AddPage(copyRectangle.DestinationImage.Clone())
Dim points(30) As LeadPoint
Dim listIndex(30) As Integer
Dim command As CorrelationListCommand = New CorrelationListCommand(correlationImage, points, listIndex, 1, 1, 90)
command.Run(image)
End Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
using Leadtools;
using Leadtools.ImageProcessing;
using Leadtools.Examples;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
public void CorrelationListConstructorExample(RasterImage image, Stream outStream)
{
CopyRectangleCommand copyRectangle = new CopyRectangleCommand();
LeadRect rc_cor = new LeadRect(327, 378, 22, 28);
copyRectangle.Rectangle = rc_cor;
copyRectangle.Run(image);
RasterImage correlationImage = copyRectangle.DestinationImage.Clone();
rc_cor = new LeadRect(283, 378, 22, 28);
copyRectangle.Rectangle = rc_cor;
copyRectangle.Run(image);
correlationImage.AddPage(copyRectangle.DestinationImage.Clone());
LeadPoint[] points = new LeadPoint[30];
int[] listIndex = new int[30];
CorrelationListCommand command = new CorrelationListCommand(correlationImage, points, listIndex, 1, 1, 90);
command.Run(image);
// Save result image
RasterCodecs codecs = new RasterCodecs();
codecs.Save(image, outStream, RasterImageFormat.Jpeg, 24);
image.Dispose();
}
Imports Leadtools
Imports Leadtools.ImageProcessing
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Core
Public Sub CorrelationListConstructorExample(ByVal image As RasterImage, ByVal outStream As Stream)
Dim copyRectangle As CopyRectangleCommand = New CopyRectangleCommand()
Dim rc_cor As LeadRect = New LeadRect(327, 378, 22, 28)
copyRectangle.Rectangle = rc_cor
copyRectangle.Run(image)
Dim correlationImage As RasterImage = copyRectangle.DestinationImage.Clone()
rc_cor = New LeadRect(283, 378, 22, 28)
copyRectangle.Rectangle = rc_cor
copyRectangle.Run(image)
correlationImage.AddPage(copyRectangle.DestinationImage.Clone())
Dim points As LeadPoint() = New LeadPoint(29) {}
Dim listIndex As Integer() = New Integer(29) {}
Dim command As CorrelationListCommand = New CorrelationListCommand(correlationImage, points, listIndex, 1, 1, 90)
command.Run(image)
' Save result image
Dim codecs As RasterCodecs = New RasterCodecs()
codecs.Save(image, outStream, RasterImageFormat.Jpeg, 24)
image.Dispose()
End Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.